<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('创建任务列表')" />
    <th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="role-form">
                <div class="select-list">
                    <ul>
                        <li>
                            任务名称：<input type="text" name="roleName"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>


        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>

    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:role:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:role:remove')}]];
    var prefix = ctx + "cms/taskreceive";

    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            sortName: "title",
            modalName: "任务",
            columns: [{
                checkbox: true
            },
                {
                    field: 'title',
                    title: '任务名称'
                },
                {
                    field: 'endDate',
                    title: '任务截止时间',
                    sortable: true
                },
                {
                    field: 'user_name',
                    title: '执行人员',
                    sortable: true
                },
                {
                    field: 'astatus',
                    title: '状态',
                    sortable: true,
                    formatter: function (value, row, index) {
                        if (row.astatus == "2"){
                            return "已放弃";
                        }
                        return row.astatus=="0"?"未完成":"已完成";
                    }
                },
                {
                    //visible: editFlag == 'hidden' ? false : true,
                    field: 'urgency',
                    title: '紧急程度',
                    sortable: true,

                    formatter: function (value, row, index) {
                        if (row.urgency=="0"){
                            return "一般";
                        }
                        return row.urgency=="1"?"紧急":"非常紧急";
                    }
                },

                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>查看</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });




</script>
</body>
</html>

</body>
</html>